package listados;

import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.util.List;
import java.util.Vector;

import javax.swing.BorderFactory;
import javax.swing.JFrame;

import accesoADatos.AccesoADatos;

import datos.Proveedor;

public class ListadoProveedores extends ListadoDialog{

	@SuppressWarnings("unchecked")
	public ListadoProveedores(JFrame frame, Vector v) {
		super(frame, v);
		this.setTitle("Listado de Proveedores");
		this.remove(this.jPanel1);
		this.jPanel1 = null;
		this.paneListados1.getJButton1().setVisible(false);
		this.paneListados1.setPreferredSize(new Dimension(1020,320));
		this.paneListados1.getJScrollPane1().setPreferredSize(new Dimension(1000,300));
		this.pack();
		this.setSize(new Dimension(1050,450));
		this.setLocationRelativeTo(null);
		ActionEvent evt = null;
		jButton1ActionPerformed(evt);
		this.setVisible(true);
	}

	private static final long serialVersionUID = 1L;

	@SuppressWarnings("unchecked")
	@Override
	public Vector cargarVector(Object object) {
		Proveedor p=(Proveedor) object;
		Vector v=new Vector();
		v.add(p.getNombre());
		v.add(p.getDireccion());
		v.add(p.getCiudad());
		v.add(p.getTelefono());
		v.add(p.getCelular());
		v.add(p.getEmail());
		v.add(p.getCp());
		v.add(p.getWeb());
		return v;
	}

	@Override
	public List getLista() {
		List l=AccesoADatos.getInstance().getProveedores();
		return l;
	}
	

}
